Simple Email Service (SES)


  • Testing
    # Test Simple Email Service (SES)
    aws ses send-email help
    aws ses send-email \
    --from myron@somewhere.io \
    --to myron@xx.io \
    --subject test \
    --text 'test msg'
    
    aws --region us-west-2 ses send-email \
    --from x@xx.org \
    --reply-to-addresses x@xx.org \
    --destination file://dest-me.json \
    --message file://message.json
    
    # dest.json
    {
      "ToAddresses":  [],
      "CcAddresses":  [],
      "BccAddresses": ["x@x.com",]
    }
    
    # message.json
    {
       "Subject": {
           "Data": "Test email sent using the AWS CLI",
           "Charset": "UTF-8"
       },
       "Body": {
           "Text": {
               "Data": "This is the message body in text format.",
               "Charset": "UTF-8"
           },
           "Html": {
               "Data": "This message body contains HTML formatting. It can, for example, contain links like this one: <a class=\"ulink\" href=\"http://docs.aws.amazon.com/ses/latest/DeveloperGuide\" target=\"_blank\">Amazon SES Developer Guide</a>.",
               "Charset": "UTF-8"
           }
       }
    }
  • Receiving
    • 40MB limit to S3
    • 150KB limit to SNS
    • Rule Policy
      {
        "Version":"2012-10-17",
        "Statement":[
          {
            "Sid":"AllowSESPuts",
            "Effect":"Allow",
            "Principal":{
              "Service":"ses.amazonaws.com"
            },
            "Action":"s3:PutObject",
            "Resource":"arn:aws:s3:::xx-email/*",
            "Condition":{
              "StringEquals":{
                "AWS:SourceAccount":"2623x09",
                "AWS:SourceArn": "arn:aws:ses:us-west-2:262x809:receipt-rule-set/data-input-1:receipt-rule/data-in-rule-1"
              }
            }
          }
        ]
      }
      
      
      xx.io	A	
      151.101.1.195
      151.101.65.195
      
      xx.io	MX	
      10 inbound-smtp.us-west-2.amazonaws.com
      
      xx.io	NS	
      ns-x.awsdns-55.co.uk.
      ns-x.awsdns-04.com.
      ns-x.awsdns-35.org.
      ns-x.awsdns-21.net.
      
      xx.io	SOA	
      ns-1983.awsdns-55.co.uk. awsdns-hostmaster.amazon.com. 1 7200 900 1209600 86400
      
      xx.io	TXT	
      "v=spf1 include:_spf.firebasemail.com ~all"
      "firebase=xx-pro-fb666"
      "google-site-verification=06hm8OrPLUEu5xxxkDpP1UQIGA1E"
      
      _de161b05bxx8e70f8a53.xx.io	CNAME	
      _1973327xxx9f39ed722e.bsgbmzkfwj.acm-validations.aws.
      
      firebase1._domainkey.xx.io	CNAME	
      mail-xx-io.dkim1._domainkey.firebasemail.com.
      
      firebase2._domainkey.xx.io	CNAME	
      mail-xx-io.dkim2._domainkey.firebasemail.com.
      
      admin.xx.io	A	
      xx-elb-4202x7.us-west-2.elb.amazonaws.com.
      
      api.xx.io	A	
      xx-elb-4202x.us-west-2.elb.amazonaws.com.
      
      bastion.xx.io	A	
      x3.65.83
      
      dashboard.xx.io	A	
      x-elb-4202x.us-west-2.elb.amazonaws.com.
      
      x-sync.xx.io	A	
      dualstack.x-elb-42022x.us-west-2.elb.amazonaws.com.
    • Updated ses policy. See Sending auth policies on verified identities
      {
           "Version": "2008-10-17",
           "Statement": [
               {
                   "Effect": "Allow",
                   "Principal": {
                       "Service": ["pinpoint.amazonaws.com"]
                   },
                   "Action": "ses:*",
                   "Resource": "arn:aws:ses:us-west-2:262x9:identity/support@xx.io",
                   "Condition": {
                       "StringEquals": {
                           "aws:SourceAccount": "2623x09"
                       },
                       "StringLike": {
                           "aws:SourceArn": "arn:aws:mobiletargeting:us-west-2:26235xx9:apps/*"
                       }
                   }
               }
           ]
       }
  • Google via

    Remove "via" information from emails not sent through Gmail

    Gmail checks whether the messages you send are authenticated.

    • Publish an SPF record that includes the IPs of the vendor or affiliates which send your messages.
    • Sign your messages with a DKIM signature that is associated with your domain.
    • Make sure the domain in the "From:" address matches the domain you're using to authenticate your emails.
  • Sample Send
    # sample raw send
    EHLO xx.io
    AUTH LOGIN
    QUtJQVVxHU1I=
    QkoyMGV5b0Q5xxxkRXRVNWM=
    MAIL FROM: support@x.io
    RCPT TO: support@x.io
    DATA
    From: Support <support@x.io>
    To: myron@x.io
    Subject: Amazon SES SMTP Test
    
    This message was sent using the Amazon SES SMTP interface.
    .
    QUIT
  • SES and SMS
    
    Limit increase request 1
    Service: SNS Text Messaging
    Region: US West (Oregon)
    Resource Type: General Limits
    Limit name: Account Spend Threshold Increase for SMS
    New limit value: 20
    ------------
    Use case description: 
      We are using SMS (initiated by users) to invite people to our app as 
      an alternative to email.  
      This request is for our development/test environment so message volume
      will be relatively low and SMS messages will most likely only be sent in US,
      UY and NZ though ultimately we will branch out into Europe and beyond.
    
    Provide a link to the site or app which will be sending SMS messages: 
    
    What type of messages do you plan to send?: Transactional
    
    Which AWS Region will you be sending messages from?: US West (Oregon)
    
    Which countries do you plan to send messages to?: 
    
    How do your customers opt to receive messages from you? 
    
    Provide specific information about the opt-in process: 
    
    Please provide the message template that you plan to use 
      to send messages to your customers:
    
    ------------
    ------------
    Limit increase request 1
    Service: SES Sending Limits
    Region: US West (Oregon)
    Limit name: Desired Daily Sending Quota
    New limit value: 100
    ------------
    Use case description: 
      The use of email from within our mobile application 
      is for login and subscription purposes and we only email 
      users in response to initial signup (to validate email) 
      and for forgotten password and password resets.
    
    Mail Type: Transactional
    
    Website URL: 
    
    Describe, in detail, how you will only send to recipients who have 
    specifically requested your mail: 
      We are using emails for validation  of subscription 
      (login and password reset) and these can only be initiated by user 
      within our mobile application.
    
    Describe, in detail, the process that you will follow when you 
    receive bounce and complaint notifications: 
    
    Will you will comply with 
    <a href="http://aws.amazon.com/service-terms/ " target="_blank">
    AWS Service Terms</a> 
    and <a href="http://aws.amazon.com/aup/ " target="_blank">AUP</a>:
      Yes